//
//  NetLBS.m
//  carcareIOS
//
//  Created by ileo on 16/8/16.
//  Copyright © 2016年 chezheng. All rights reserved.
//

#import "NetLBS.h"
#import "NetEngineServer.h"
#import "AIUserInfo.h"

@implementation NetLBS

+(void)lbsInfoSuccess:(void (^)(LBSModel *))success{
    [[__SELF request:@"/lbs/storeInfo" withParams:nil type:REQUEST_POST] requestSuccess:^(id JSON) {
        if (success) {
            success([[LBSModel alloc] initWithDic:JSON[@"info"]]);
        }
    }];
}

+(void)lbsResetOpen:(BOOL)open success:(void (^)())success{
    [[__SELF request:@"/setting/lbs" withParams:@{@"flag":open?@1:@0} type:REQUEST_POST] requestSuccess:^(id JSON) {
        if (success) {
            success();
        }
    }];
}

-(NSDictionary *)requestCommonParams{
    if (![USERINFO.session isNotNil]) {
        return nil;
    }
    return @{@"userid":@(USERINFO.userID),@"session":USERINFO.session};
}

@end
